package com.cy1;

import java.io.File;

public class FileDemo3 {
    public static void main(String[] args) {
        File file = new File("D:\\Project\\Java");
        System.out.println(file.exists());
        String[] list = file.list();
        for (String s : list) {
            System.out.println(s);
      }
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getPath());
        System.out.println(file.getName());
        File[] files = file.listFiles();
        for (File file1 : files) {
           if(file1.isDirectory()){
               System.out.println(file1);
           }
        }

    }
}
